﻿using Ecommerce.API.Application.Command.LeaveCommand;
using Ecommerce.Domain.Dto;
using Ecommerce.Domain.Holiday;
using Ecommerce.Services.Leaves;
using MediatR;

namespace Ecommerce.API.Application.CommandHandlers.LeaveHandler
{
    public class LeavedShowCommandHandler : IRequestHandler<LeadShowCommand, List<LeacPart>>
    {
        private readonly ILeaveServices services;

        public LeavedShowCommandHandler(ILeaveServices services)
        {
            this.services = services;
        }

        public Task<List<LeacPart>> Handle(LeadShowCommand request, CancellationToken cancellationToken)
        {
            return services.GetLeaves(request.BName);
        }
    }
}
